<!DOCTYPE html>  
<html>  
  <head>  
    <title>Variables</title>  
  </head>
  <body>  
    <script type="text/javascript">  
       var name = "John";
       var _text = "Hello";
       document.write(name+" "+_text); 
       document.write("<br>"); 
       
       var myNum = 15;
       document.write(myNum); 
       document.write("<br>"); 
   
       var myNum2;
       myNum2 = 16;
       document.write(myNum2); 
       document.write("<br>"); 
   
       var myNum3 = 15;
       myNum3 = 20;
       document.write(myNum3); 
       document.write("<br>"); 
       
       var x = 5, y = 6, z = 50;
       document.write(x + y + z); 
       document.write("<br>"); 
       
       function abc(){  
          var x = 10;//local variable  
          document.write(x); 
          document.write("<br>"); 
       }
       
       abc();
       
       if(10<13){  
          var y = 20;//local variable  
          document.write(y); 
          document.write("<br>"); 
       }  

       document.write(x); 
    </script> 
  </body>  
</html>